﻿using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;

namespace WebSystem
{
    /// <summary>
    /// GetUploadFileType 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class GetUploadFileType : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        //获取上传文件类型
        [WebMethod]
        public bool GetType(string stringType)
        {
            bool result = false;
            string uploadType = "rar|arj|doc|txt|xls|pdf|jpg|gif|bmp|jpeg";

                string[] arrString = uploadType.Split('|');

                for (int i = 0; i < arrString.Length; i++)
                {
                    if (stringType.ToLower() == arrString[i].ToLower().Trim())
                    {
                        result = true;
                        break;
                    }
                }
            return result;
        }
    }
}
